package com.dimples.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Date;

import javax.validation.constraints.NotBlank;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 用户
 *
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2021/6/25
 */
@ApiModel(value = "com-dimples-system-entity-User")
@Data
@TableName(value = "t_user")
public class SysUser {

    /**
     * 注册用户角色ID
     */
    public static final Long REGISTER_ROLE_ID = 2L;

    /**
     * 用户状态：有效
     */
    public static final String STATUS_VALID = "1";
    /**
     * 用户状态：锁定
     */
    public static final String STATUS_LOCK = "0";
    /**
     * 默认头像
     */
    public static final String DEFAULT_AVATAR = "avatar.jpg";
    /**
     * 默认密码
     */
    public static final String DEFAULT_PASSWORD = "123456";
    /**
     * 性别男
     */
    public static final String SEX_MALE = "1";
    /**
     * 性别女
     */
    public static final String SEX_FEMALE = "0";
    /**
     * 性别保密
     */
    public static final String SEX_UN_KNOW = "2";
    /**
     * 黑色主题
     */
    public static final String THEME_BLACK = "dark-theme";
    /**
     * 白色主题
     */
    public static final String THEME_WHITE = "light-theme";

    /**
     * 用户ID
     */
    @TableId(value = "USER_ID", type = IdType.AUTO)
    @ApiModelProperty(value = "用户ID")
    private Long userId;

    /**
     * 用户名
     */
    @TableField(value = "USERNAME")
    @ApiModelProperty(value = "用户名")
    @NotBlank(message = "不能为空")
    private String username;

    /**
     * 用户名
     */
    @TableField(value = "REAL_NAME")
    @ApiModelProperty(value = "姓名")
    @NotBlank(message = "不能为空")
    private String realName;

    /**
     * 密码
     */
    @TableField(value = "`PASSWORD`")
    @ApiModelProperty(value = "密码")
    private String password;

    /**
     * 部门ID
     */
    @TableField(value = "DEPT_ID")
    @ApiModelProperty(value = "部门ID")
    private Long deptId;

    /**
     * 邮箱
     */
    @TableField(value = "EMAIL")
    @ApiModelProperty(value = "邮箱")
    private String email;

    /**
     * 联系电话
     */
    @TableField(value = "MOBILE")
    @ApiModelProperty(value = "联系电话")
    private String mobile;

    /**
     * 状态 0锁定 1有效
     */
    @TableField(value = "`STATUS`")
    @ApiModelProperty(value = "状态 0锁定 1有效")
    private String status;

    /**
     * 创建时间
     */
    @TableField(value = "CREATE_TIME")
    @ApiModelProperty(value = "创建时间", hidden = true)
    private Date createTime;

    /**
     * 修改时间
     */
    @TableField(value = "MODIFY_TIME")
    @ApiModelProperty(value = "修改时间", hidden = true)
    private Date modifyTime;

    /**
     * 最近访问时间
     */
    @TableField(value = "LAST_LOGIN_TIME")
    @ApiModelProperty(value = "最近访问时间", hidden = true)
    private Date lastLoginTime;

    /**
     * 性别 0女 1男
     */
    @TableField(value = "SSEX")
    @ApiModelProperty(value = "性别 0女 1男")
    private String ssex;

    /**
     * 主题
     */
    @TableField(value = "THEME")
    @ApiModelProperty(value = "主题")
    private String theme;

    /**
     * 头像
     */
    @TableField(value = "AVATAR")
    @ApiModelProperty(value = "头像")
    private String avatar;

    /**
     * 描述
     */
    @TableField(value = "DESCRIPTION")
    @ApiModelProperty(value = "描述")
    private String description;

    @TableField(exist = false)
    @ApiModelProperty(value = "科室名称", hidden = true)
    private String deptName;

    @TableField(exist = false)
    @ApiModelProperty(value = "默认角色id")
    private Long roleId;

    @TableField(exist = false)
    @ApiModelProperty(value = "默认角色名称")
    private String roleName;
}